home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Maths & Calculations / display-days-remainin-in-year.izs < prev    next >
Text File  |  2005-07-20  |  1KB  |  48 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Display days remaining in year
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Each year comes and goes. Use this script to display how many days remain in the current year.
  7. <!/DESCRIPTION> 
  8.  
  9. <!CATEGORY>Counters<!/CATEGORY>
  10.  
  11. <!SCRIPT>
  12. <!-- START OF SCRIPT -->
  13. <!-- Simply insert the below into the <body> section of your page:  -->
  14. <script>
  15.  
  16. today=new Date()
  17. var endofyear=new Date(today.getFullYear(), 11, 31)
  18. var one_day=1000*60*60*24
  19.  
  20. //Calculate difference btw the two dates, and convert to days
  21. document.write("<b>"+Math.ceil((endofyear.getTime()-today.getTime())/(one_day))+"</b> days remaining this year!")
  22.  
  23. </script>
  24.  
  25.  
  26. <!-- END OF SCRIPT -->
  27. <!/SCRIPT>
  28.  
  29. <!PREVIEW>
  30. <!-- START OF SCRIPT -->
  31.  
  32. <!-- Simply insert the below into the <body> section of your page:  -->
  33. <script>
  34.  
  35. today=new Date()
  36. var endofyear=new Date(today.getFullYear(), 11, 31)
  37. var one_day=1000*60*60*24
  38.  
  39. //Calculate difference btw the two dates, and convert to days
  40. document.write("<b>"+Math.ceil((endofyear.getTime()-today.getTime())/(one_day))+"</b> days remaining this year!")
  41.  
  42. </script>
  43.  
  44.  
  45. <!-- END OF SCRIPT -->
  46. <!/PREVIEW>
  47.  
  48. <!RELATED>NONE<!/RELATED>